/**
业主详情页面
 **/
(function (vc) {
    vc.extends({
        data: {
            aShopDataInfo: {
                shopId: '',
                shopName: '',
                shopTypeName:'',
                storeName: '',
                storeAddress: '',
                storeTel: '',
                stateName: '',
                createTime: '',
                _currentTab: 'aShopDetailProduct',
            }
        },
        _initMethod: function () {
            vc.emit('adminShop', 'initShop', function (_shop) {
                $that.aShopDataInfo.shopId = _shop.shopId;
                $that._listAShopDetail();
            });
            $that.changeTab($that.aShopDataInfo._currentTab);

        },
        _initEvent: function () {
            vc.on('aShopDetail', 'listCarData', function (_info) {
                //$that._loadFeeDetailInfo();
                $that.changeTab($that.aShopDataInfo._currentTab);
            });
        },
        methods: {
            _listAShopDetail: function () {
                let _shopId = $that.aShopDataInfo.shopId;
                if(!_shopId){
                    $that.changeTab($that.aShopDataInfo._currentTab);
                    return;
                }

                let param = {
                    params: {
                        page:1,
                        row:1,
                        shopId:_shopId
                    }
                };

                //发送get请求
                vc.http.apiGet('/shop.queryShopsByAdmin',
                    param,
                    function (json, res) {
                        let _json = JSON.parse(json);
                        vc.copyObject(_json.data[0],$that.aShopDataInfo);
                        $that.changeTab($that.aShopDataInfo._currentTab);
                    }, function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            changeTab: function (_tab) {
                $that.aShopDataInfo._currentTab = _tab;
               
                vc.emit(_tab, 'switch', {
                    shopId: $that.aShopDataInfo.shopId,
                });
            },
           
        }
    });
})(window.vc);